#!/usr/bin/env python
# coding=utf-8

import Adafruit_DHT


class Ht(object):
    sensor = Adafruit_DHT.DHT11
    channel = 4 #BCM

    def retHumTem(self):
        humidity, temperature = Adafruit_DHT.read_retry(self.sensor, self.channel)
        if humidity is not None and temperature is not None:
            return (humidity, temperature)
        else:
            return(0, 0)
if __name__ == "__main__":
    ht = Ht()
    print(th.retTemHum())


